<script setup>
import QRCode from 'qrcode'


onMounted(() => {
  QRCode.toCanvas(document.getElementById('qrcode-app'), "https://a.app.qq.com/o/simple.jsp?pkgname=com.yquestion.zzwx", {
    width: 110,
    height: 110,
    color: {
      dark: '#000000', // 黑色
      light: '#ffffff' // 白色
    }
  }, function (error) {
    if (error) console.error(error);
    console.log('QR code generated successfully!');
  });
});
</script>

<template>
  <div class="app-download-container">
    <div class="content-container">
      <div class="a">

      </div>
      <div class="b">
        <div class="c">
          <img src="@/assets/images/logo11.png">
          <span>中震网校APP</span>
        </div>
        <div class="d">
          <p>【中震网校】涵盖建工类、安全工程类、财经类、医卫 类、职业资格类、平面UI设计类、外语类、教师公考类、职称类等百余项课 程。在线直播，精品课程常更新。</p>
        </div>
        <div class="e">
          <div class="canvas-container">
            <canvas id="qrcode-app"></canvas>
            <div class="tips">
              <span>手机扫码下载<br/>立即体验</span>
            </div>
          </div>

        </div>
      </div>
    </div>
  </div>
</template>

<style scoped>
.app-download-container {
  background: url('@/assets/images/app_background.png');
  background-size: cover;
}

.content-container {
  width: 1100px;
  margin: 0 auto;
  display: flex;
  gap: 50px;
}

.a {
  width: 355px;
  height: 355px;
  background-image: url("@/assets/images/手机.png");
  background-size: 100%;
  background-repeat: no-repeat;
  align-self: flex-end;
}
.b{
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding: 100px 0;
}
.c{
  display: flex;
  align-items: center;
  gap: 20px;
}
.c img{
  width: 100px;
  height: 100px;
  border-radius: 12px;
}
.c span{
  color: #171920;
  font-size: 35.016px;
  font-weight: 600;
  line-height: 28px;
}
#qrcode-app{
  width: 110px;
  height: 110px;

}
.canvas-container{
  display: flex;
  gap: 10px;
}
.tips{
  width: 100px;
  align-self: flex-end;
}
 </style>